const jwt = require("jsonwebtoken")
const security = require("./tokentime").security

function gentoken(uid, scope = 2) {
    const secretkey = security.secretKey
    const expiresIn = security.expiresIn
    const token = jwt.sign({uid,scope},secretkey,{expiresIn})
    return token
}

module.exports = {gentoken}
